<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
			
	String strFlag = (String)request.getParameter("flag");
%>
<!DOCTYPE HTML>
<html>
	<head>
		<base href="<%=basePath%>">
		<META http-equiv=Content-Type content="text/html; charset=utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="renderer" content="webkit|ie-comp|ie-stand">
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<link type="text/css" rel="stylesheet" href="include/css/bootstrap.css" />
		<link rel="stylesheet" href="include/css/bootstrap-table.min.css" type="text/css"/>
		<link type="text/css" rel="stylesheet" href="include/iconFont/1.0.8/iconfont.css"/ >
		<script type="text/javascript" src="include/js/jquery-1.8.3.js"></script>
		<script type="text/javascript" src="include/js/bootstrap.min.js"></script>
		<script type="text/javascript" src="include/js/bootstrap-table.js"></script>
		<script type="text/javascript" src="include/js/bootstrap-table-zh-CN.js"></script>
	</head>
	<script type="text/javascript">
		var flags = <%=strFlag%>;
		
		$(document).ready(function(){
			
			
			if(1 == flags || 2 == flags)
			{
				$('#cardviewtable').bootstrapTable({
			    url: "JqueryAction/getCountViews.action?flag="+flags, 
			    dataType: "json",
			    dataField: "rows",
			    pagination: true,
			    pageSize: 5,
			    pageList: [5, 10, 20, 50],//分页步进值
			    striped: false,  
			    singleSelect: true,
		        columns:[
                {
                  	title: '客户姓名',
                    field: 'popName',
                    align: 'center',
                    width:'150px'
                }, 
                {
                    title: '产品分类',
                    field: 'productTypeName',
                    align: 'center',
                    width:'70px'
                },
                {
                    title: '产品规格',
                    field: 'productSpecName',
                    align: 'center'
                },
                {
                    title: '客户联系电话',
                    field: 'popPhone',
                    align: 'left',
                    width:'110px'
                },
                {
                    title: '客户预约安装时间',
                    field: 'setupTime',
                    align: 'left',
                    width:'220px',
                    formatter:function(value,row,index){ 
						var d = new Date(value);
						var date = (d.getFullYear()) + "年" + (d.getMonth() + 1) + "月" + (d.getDate()) + "日" + " ";
						
						if(d.getHours()>12)
						{
							date+=" 下午 "+ (d.getHours()) + "点" + (d.getMinutes()) + "分";
						}
						else
						{
							date+=" 上午 "+ (d.getHours()) + "点" + (d.getMinutes()) + "分";
						}
                        return date;  
                   	}
                },
                {
                   title: '客户安装地址',
                   field: 'popAddress',
                   align: 'left',
                   width:'240px'
		        }
            	] 
            });
			}
			
			if(5 == flags)
			{
				$('#cardviewtable').bootstrapTable({
			    url: "JqueryAction/getCountViews.action?flag="+flags, 
			    dataType: "json",
			    dataField: "rows",
			    pagination: true,
			    pageSize: 5,
			    pageList: [5, 10, 20, 50],//分页步进值
			    striped: false,  
			    singleSelect: true,
		        columns:[
                {
                  	title: '客户姓名',
                    field: 'popName',
                    align: 'center',
                    width:'240px'
                }, 
                {
                    title: '产品分类',
                    field: 'productTypeName',
                    align: 'center',
                    width:'120px'
                },
                {
                    title: '产品规格',
                    field: 'productSpecName',
                    align: 'center',
                    width:'120px'
                },
                {
                    title: '客户联系电话',
                    field: 'popPhone',
                    align: 'center',
                    width:'150px'
                },
                {
                    title: '客户预约安装时间',
                    field: 'setupTime',
                    align: 'left',
                    width:'260px',
                    formatter:function(value,row,index){ 
						var d = new Date(value);
						var date = (d.getFullYear()) + "年" + (d.getMonth() + 1) + "月" + (d.getDate()) + "日" + " ";
						
						if(d.getHours()>12)
						{
							date+=" 下午 "+ (d.getHours()) + "点" + (d.getMinutes()) + "分";
						}
						else
						{
							date+=" 上午 "+ (d.getHours()) + "点" + (d.getMinutes()) + "分";
						}
                        return date;  
                   	}
                }
            	] 
            });
			}
			
			if(4 == flags)
			{
				$('#cardviewtable').bootstrapTable({
			    url: "JqueryAction/getCountViews.action?flag=4", 
			    dataType: "json",
			    dataField: "rows",
			    pagination: true,
			    pageSize: 5,
			    pageList: [5, 10, 20, 50],//分页步进值
			    striped: false,  
			    singleSelect: true,
		        columns:[
                {
                  	title: '客户姓名',
                    field: 'popName',
                    align: 'center',
                    width:'150px'
                }, 
                {
                    title: '产品分类',
                    field: 'productTypeName',
                    align: 'center',
                    width:'90px'
                },
                {
                    title: '产品规格',
                    field: 'productSpecName',
                    align: 'center',
                    width:'90px'
                },
                {
                    title: '客户联系电话',
                    field: 'popPhone',
                    align: 'left',
                    width:'110px'
                },
                {
                    title: '客户预约安装时间',
                    field: 'setupTime',
                    align: 'left',
                    width:'220px',
                    formatter:function(value,row,index){ 
						var d = new Date(value);
						var date = (d.getFullYear()) + "年" + (d.getMonth() + 1) + "月" + (d.getDate()) + "日" + " ";
						
						if(d.getHours()>12)
						{
							date+=" 下午 "+ (d.getHours()) + "点" + (d.getMinutes()) + "分";
						}
						else
						{
							date+=" 上午 "+ (d.getHours()) + "点" + (d.getMinutes()) + "分";
						}
                        return date;  
                   	}
                },
                {
                    title: '客户改延迟安装时间',
                    field: 'lazyTime',
                    align: 'left',
                    width:'220px',
                    formatter:function(value,row,index){ 
						var d = new Date(value);
						var date = (d.getFullYear()) + "年" + (d.getMonth() + 1) + "月" + (d.getDate()) + "日" + " ";
						
						if(d.getHours()>12)
						{
							date+=" 下午 "+ (d.getHours()) + "点" + (d.getMinutes()) + "分";
						}
						else
						{
							date+=" 上午 "+ (d.getHours()) + "点" + (d.getMinutes()) + "分";
						}
                        return date;  
                   	}
                },
                {
                   title: '客户安装地址',
                   field: 'popAddress',
                   align: 'left'
		        }
            	] 
            });
			}
			
			
			if(3 == flags)
			{
				$('#cardviewtable').bootstrapTable({
			    url: "JqueryAction/getCountViews.action?flag=3", 
			    dataType: "json",
			    dataField: "rows",
			    pagination: true,
			    pageSize: 5,
			    pageList: [5, 10, 20, 50],//分页步进值
			    striped: false,  
			    singleSelect: true,
		        columns:[
                {
                  	title: '客户姓名',
                    field: 'popName',
                    align: 'center',
                    width:'150px'
                }, 
                {
                    title: '产品分类',
                    field: 'productTypeName',
                    align: 'center',
                    width:'90px'
                },
                {
                    title: '产品规格',
                    field: 'productSpecName',
                    align: 'center',
                    width:'90px'
                },
                {
                    title: '客户联系电话',
                    field: 'popPhone',
                    align: 'left',
                    width:'110px'
                },
                {
                    title: '客户预约安装时间',
                    field: 'setupTime',
                    align: 'left',
                    width:'235px',
                    formatter:function(value,row,index){ 
						var d = new Date(value);
						var date = (d.getFullYear()) + "年" + (d.getMonth() + 1) + "月" + (d.getDate()) + "日" + " ";
						
						if(d.getHours()>12)
						{
							date+=" 下午 "+ (d.getHours()) + "点" + (d.getMinutes()) + "分";
						}
						else
						{
							date+=" 上午 "+ (d.getHours()) + "点" + (d.getMinutes()) + "分";
						}
                        return date;  
                   	}
                },
                {
                    title: '异常原因',
                    field: 'remark',
                    align: 'left',
                    width:'220px'
                }
            	] 
            });
			}
		});
	</script>
	<body style="background-color: #FFFFCC;">
		<div id="container" >
			<div id="page"
				style="border-style: dashed; border-color: #e4e4e4; line-height: 10px;">
				<div class="input-group" style="margin-top: 5px;">
					<table id="cardviewtable" class="table table-hover table-striped" style="overflow: hidden;"></table>
				</div>
			</div>
		</div>
	</body>
</html>
